package design;

public class HungryStaticSingleton {
    private static final HungryStaticSingleton hungrySingleton;
    static {
        System.out.println("初始化单例");
        hungrySingleton = new HungryStaticSingleton();
    }

    private HungryStaticSingleton(){}

    public static HungryStaticSingleton getInstance(){
        return hungrySingleton;
    }

    public static void main(String[] args) {
        HungryStaticSingleton.getInstance();
    }
}
